package com.sky.mapper;


import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author: @Weiney
 * @ClassName: UserMapper
 * @Description: 用户数据库接口
 * @Create: 2025-01-25
 **/

@Mapper
public interface UserMapper {

    /**
     * 根据openId获取用户信息
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenId(String openid);

    /**
     * 插入用户
     * @param user
     */
    void insert(User user);

    @Select("select * from user where id = #{id}")
    User getById(Long userId);
}
